gtkpopover: Move GTK grabs to map/unmap
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 7 Apr 2023 19:42:10 +0000 (21:42 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 7 Apr 2023 20:12:41 +0000 (22:12 +0200)
commit17095387567028c6d14b469ab0af642af8909ab2
treeda560953983e0a08c4f8e104932f6d03c2363e0f
parentda5433e14085ce20fcecd3c5d47b11d08de718fb
gtkpopover: Move GTK grabs to map/unmap

Typically, a popover gets mapped when shown and unmapped when
hidden. A situation there that breaks is where the popover gets
recursively unmapped/unrealized when its root is destroyed.

In that situation, the popover does however unmap (without being
hidden first), moving the GTK grab from show/hide to map/unmap
will handle the previous situations, plus this one.

Fixes things being unclickable if e.g. a modal dialog got a
popover popped up, then got closed via Alt-F4.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5730
gtk/gtkpopover.c